/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package vn.support.ui.action;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;

import vn.support.connection.Connection;
import vn.support.connection.RequestConnection;
import vn.support.core.dto.DataObject;

/**
 *
 * @author nttuyen
 */
public class RequestAction extends AbstractAction {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private final DataObject data;
	private final Connection connection;
	
	public RequestAction(String name, DataObject data) {
		super(name);
		this.data = data;
		this.connection = new RequestConnection();
	}
	
    @Override
    public void actionPerformed(ActionEvent e) {
    	this.connection.execute(this.data);
    }
}
